import axios from "axios";

const token = sessionStorage.getItem('authentication');

export const getEmployeeList = (params: any) =>
    axios({
        url: "/api/admin/employee/page",
        method: "get",
        headers: {
            authentication: token,
        },
        params: params
    })

export const StartOrStopEmp = (params: any) =>
    axios({
        url: `/api/admin/employee/status/${params.status}`,
        method: 'post',
        headers: {
            authentication: token
        },
        params: {id: params.id}
    })

export const insertEmployee = (data: any) =>
    axios({
        url: "/api/admin/employee",
        method: "post",
        headers: {authentication: token},
        data: data
    })

export const getEmployeeById = (id: any) =>
    axios({
        url: `/api/admin/employee/${id}`,
        method: "get",
        headers: {authentication: token},

    })

export const updateEmployee = (data: any) =>
    axios({
        url: "/api/admin/employee",
        method: "put",
        headers: {authentication: token},
        data: data
    })
